program q132;
var
    c, i, j, k, t, n: longint;
    a, b: array[1..64] of longint;
begin
    assign(input, '');
    assign(output, '');
    reset(input);
    rewrite(output);

    readln(c);
    while (c > 0) do
    begin
        readln(n);
        for i:=1 to n do
            readln(a[i], b[i]);
        
        for i:=1 to n-1 do
            for j:=i+1 to n do
                if (a[i] > a[j]) then
                begin
                    t := a[i]; a[i] := a[j]; a[j] := t;
                    t := b[i]; b[i] := b[j]; b[j] := t;
                end;

        for i:=1 to n do
        begin
            for j:=1 to b[i] do
            begin
                write('>+');
                for k:=1 to a[i]-2 do
                    write('-');
                write('+>');
                writeln;
            end;
            writeln;
        end;

        dec(c);
    end;

    close(input);
    close(output);
end.
